/*
 * @Descripttion: GGB
 * @version: 1.0
 * @Author: GGB
 * @Date: 2021-08-20 07:51:37
 * @LastEditors: GGB
 * @LastEditTime: 2021-08-22 11:19:05
 */
import 'package:flutter/material.dart';
import 'package:flutter_data_center/controller/grade_attendance_controller.dart';
import 'package:flutter_data_center/model/attendance/grade_attendance_model.dart';
import 'package:flutter_data_center/utills/color_utils.dart';

class GradeItem extends StatelessWidget {
  const GradeItem({Key key, this.student, this.controller}) : super(key: key);
  final Persons student;
  final GradeAttendanceController controller;

  @override
  Widget build(BuildContext context) => InkWell(
        onTap: () {
          // NavigatorUtils.pushPageByFade(
          //   context: context,
          //   targetPage: TeacherDetailAttendanceScreen(),
          //   isReplace: false,
          //   startMills: 500,
          // );
        },
        child: ListTile(
          isThreeLine: false,
          minLeadingWidth: 50,
          leading: Container(
            width: 50,
            height: 50,
            child: ClipOval(
              child: Image.network(
                student.avatar,
                fit: BoxFit.cover,
              ),
            ),
          ),
          title: Text(
            student.name,
            style: TextStyle(
              color: Colors.black,
              fontSize: 16,
            ),
          ),
          subtitle: Text(
            student.time,
            style: TextStyle(
              color: gColor('#6D6D6D'),
              fontSize: 14,
            ),
          ),
          trailing: Text(
            controller.attendanceType[student.status],
            style: TextStyle(
              fontSize: 16,
              color: gColor("#08D187"),
            ),
          ),
        ),
      );
}
